{#**
*
* 功能描述（搜索模板）
*
* @author suoya <jlusuoya@gmail.com>
* @version 1
*#}
{#if !isset($s_basic)#}{#$s_basic=[]#}{#/if#}
{#if !isset($s_vdate)#}{#$s_vdate=[]#}{#/if#}
{#if !isset($s_checkbox)#}{#$s_checkbox=[]#}{#/if#}
<div class="search">
    <div class="searchTitle">
        搜索
    </div>
    <script language="javascript" type="text/javascript" src="js/My97DatePicker/WdatePicker.js"></script>
    <form id="searchForm" action="" method="POST" onsubmit="$(this).attr('action', location.href.split('&')[0]);
            form2url($(this));
            return false">
        <div class="searchBar">
            <select name="key" id="s_key">
                <option value="">请选择搜索字段</option>
                {#foreach $s_keys as $k=>$i#}<option value="{#$k#}">{#$i#}</option>{#/foreach#}
            </select>
            <input type="text" name="keyword" id="s_keyword" value="" />
            {#foreach $s_checkbox as $sk => $sv #}
                 {#if $sk == 'br'#}
                    </div>
                    <div class="searchBar">
                 {#else#}
                      <input type="checkbox" name="{#$sk#}" value="{#$sv[0]#}" {#if isset($key_search[{#$sk#}])&&$key_search[{#$sk#}] ==  $sv[0]#} checked="checked"{#/if#} />{#$sv[1]#}
                 {#/if#}
            {#/foreach#}
        </div>
        {#if isset($s_vdate) and ($s_vdate|@count neq 0) #}
            <div class="searchBar">
                {#foreach $s_vdate as $sk => $sv#}
                     {#if $sk == 'br'#}
                        </div>
                        <div class="searchBar">
                     {#else#}
                          <label class="date_search_label">{#$sv#}</label><input id="d11" name="{#$sk#}" type="text" onClick="WdatePicker({dateFmt: 'yyyy-MM-dd HH:mm:ss'})" value="{#if isset($key_search[{#$sk#}])#}{#$key_search[{#$sk#}]#}{#/if#}" readonly/>
                     {#/if#}
                {#/foreach#}
            </div>
        {#/if#}
        {#foreach $s_basic as $sk => $sv #}
            <div class="searchBar">
                <input type="hidden" name="{#$sk#}" id="s_{#$sk#}" value="{#$sv[0]#}" />
                <div class="type_search_label">{#$sv[1]#}</div>
                <div class="typeDiv">
                    <a href="#" {#if !isset($key_search[{#$sk#}]) or $key_search[{#$sk#}] == $sv[0]#} class="active"{#/if#} onclick="search_select('#s_{#$sk#}','{#$sv[0]#}','#searchForm');">全部</a> 
                    {#foreach $sv[2] as $k=>$v#}<a href="#" {#if isset($key_search[{#$sk#}]) and $key_search[{#$sk#}] == $k#} class="active"{#/if#} onclick="search_select('#s_{#$sk#}','{#$k#}','#searchForm');">{#$v#}</a> {#/foreach#}
                </div>
                {#if isset($key_search[{#$sk#}])#}<script>$("#s_{#$sk#}").val('{#$key_search[{#$sk#}]#}');</script>{#/if#}
            </div>
        {#/foreach#}
        <div class="searchBar">
            <label class="date_search_label">每页显示：</label><input type="text" name="pageSize" value="{#$pageSize#}" style="width: 40px;" />
        </div>
        <div class="buttonBar">
            <input type="submit" class="button align_right" value="查询"/>
        </div>
    </form>
    {#if isset($key_search['key'])#}
        <script>
            $("#s_key").val('{#$key_search['key']#}');
            {#if isset($key_search['keyword'])#}
                $("#s_keyword").val('{#$key_search['keyword']#}');
            {#/if#}
        </script>
    {#/if#}
</div>
